M.block_simple_clock={serverClockShown:true,userClockShown:true,showSeconds:false,showDay:false,twentyFourHourTime:false,timeDifference:0,initSimpleClock:function(YUIObject,server,user,seconds,day,tfh,y,mo,d,h,m,s){var serverTimeStart=new Date(y,mo,d,h,m,s),currentTime=new Date();this.timeDifference=currentTime.getTime()-serverTimeStart.getTime();this.serverClockShown=server;this.userClockShown=user;this.showSeconds=seconds;this.showDay=day;this.twentyFourHourTime=tfh;this.updateTime()},updateTime:function(){var serverTime,youTime;if(this.serverClockShown){serverTime=new Date();serverTime.setTime(serverTime.getTime()-this.timeDifference);document.getElementById('block_progress_serverTime').value=this.getClockString(serverTime)};if(this.userClockShown){youTime=new Date();document.getElementById('block_progress_youTime').value=this.getClockString(youTime)};setTimeout('M.block_simple_clock.updateTime()',1e3)},getClockString:function(clockTime){var clockString='',day=M.str.block_simple_clock.day_names.split(',')[clockTime.getDay()],hours=clockTime.getHours(),minutes=clockTime.getMinutes(),seconds=clockTime.getSeconds();if(this.showDay)clockString+=day+' ';if(this.twentyFourHourTime){clockString+=hours}else if(hours>12){clockString+=hours-12}else if(hours==0){clockString+=12}else clockString+=hours;clockString+=M.str.block_simple_clock.clock_separator;if(minutes<10)clockString+='0';clockString+=minutes;if(this.showSeconds){clockString+=M.str.block_simple_clock.clock_separator;if(seconds<10)clockString+='0';clockString+=seconds};if(!this.twentyFourHourTime)if(hours<12){clockString+=M.str.block_simple_clock.before_noon}else clockString+=M.str.block_simple_clock.after_noon;return clockString}}